package generalpattern.diagram.part;

import generalpattern.diagram.edit.parts.Component2EditPart;
import generalpattern.diagram.edit.parts.Component3EditPart;
import generalpattern.diagram.edit.parts.ComponentComponentCompartment2EditPart;
import generalpattern.diagram.edit.parts.ComponentComponentCompartment3EditPart;
import generalpattern.diagram.edit.parts.ComponentComponentCompartmentEditPart;
import generalpattern.diagram.edit.parts.ComponentEditPart;
import generalpattern.diagram.edit.parts.ComponentName2EditPart;
import generalpattern.diagram.edit.parts.ComponentName3EditPart;
import generalpattern.diagram.edit.parts.ComponentNameEditPart;
import generalpattern.diagram.edit.parts.ComponentPortEditPart;
import generalpattern.diagram.edit.parts.Connector2EditPart;
import generalpattern.diagram.edit.parts.Connector3EditPart;
import generalpattern.diagram.edit.parts.ConnectorConnectorCompartment2EditPart;
import generalpattern.diagram.edit.parts.ConnectorConnectorCompartment3EditPart;
import generalpattern.diagram.edit.parts.ConnectorConnectorCompartmentEditPart;
import generalpattern.diagram.edit.parts.ConnectorEditPart;
import generalpattern.diagram.edit.parts.ConnectorName2EditPart;
import generalpattern.diagram.edit.parts.ConnectorName3EditPart;
import generalpattern.diagram.edit.parts.ConnectorNameEditPart;
import generalpattern.diagram.edit.parts.ConnectorRoleEditPart;
import generalpattern.diagram.edit.parts.ConstraintEditPart;
import generalpattern.diagram.edit.parts.ConstraintNameEditPart;
import generalpattern.diagram.edit.parts.Multiplicity2EditPart;
import generalpattern.diagram.edit.parts.MultiplicityEditPart;
import generalpattern.diagram.edit.parts.Overlapping2EditPart;
import generalpattern.diagram.edit.parts.OverlappingEditPart;
import generalpattern.diagram.edit.parts.Pattern2EditPart;
import generalpattern.diagram.edit.parts.Pattern3EditPart;
import generalpattern.diagram.edit.parts.Pattern4EditPart;
import generalpattern.diagram.edit.parts.PatternEditPart;
import generalpattern.diagram.edit.parts.PatternName2EditPart;
import generalpattern.diagram.edit.parts.PatternName3EditPart;
import generalpattern.diagram.edit.parts.PatternNameEditPart;
import generalpattern.diagram.edit.parts.PatternPatternCompartment2EditPart;
import generalpattern.diagram.edit.parts.PatternPatternCompartment3EditPart;
import generalpattern.diagram.edit.parts.PatternPatternCompartmentEditPart;
import generalpattern.diagram.edit.parts.Role2EditPart;
import generalpattern.diagram.edit.parts.RoleEditPart;
import generalpattern.diagram.edit.parts.RoleName2EditPart;
import generalpattern.diagram.edit.parts.RoleNameEditPart;
import generalpattern.diagram.edit.parts.RoleRoleCompartment2EditPart;
import generalpattern.diagram.edit.parts.RoleRoleCompartmentEditPart;
import generalpattern.diagram.edit.parts.Stringing2EditPart;
import generalpattern.diagram.edit.parts.StringingEditPart;

import org.admanager.generalpattern.plugin.generalpattern.Pattern;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;

/**
 * This registry is used to determine which type of visual object should be
 * created for the corresponding Diagram, Node, ChildNode or Link represented
 * by a domain model object.
 * 
 * @generated
 */
public class GeneralPatternMetamodelVisualIDRegistry {

	/**
	 * @generated
	 */
	private static final String DEBUG_KEY = "org.admanager.generalpattern.plugin.diagram/debug/visualID"; //$NON-NLS-1$

	/**
	 * @generated
	 */
	public static int getVisualID(View view) {
		if (view instanceof Diagram) {
			if (PatternEditPart.MODEL_ID.equals(view.getType())) {
				return PatternEditPart.VISUAL_ID;
			} else {
				return -1;
			}
		}
		return generalpattern.diagram.part.GeneralPatternMetamodelVisualIDRegistry
				.getVisualID(view.getType());
	}

	/**
	 * @generated
	 */
	public static String getModelID(View view) {
		View diagram = view.getDiagram();
		while (view != diagram) {
			EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
			if (annotation != null) {
				return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
			}
			view = (View) view.eContainer();
		}
		return diagram != null ? diagram.getType() : null;
	}

	/**
	 * @generated
	 */
	public static int getVisualID(String type) {
		try {
			return Integer.parseInt(type);
		} catch (NumberFormatException e) {
			if (Boolean.TRUE.toString().equalsIgnoreCase(
					Platform.getDebugOption(DEBUG_KEY))) {
				GeneralPatternMetamodelDiagramEditorPlugin.getInstance()
						.logError(
								"Unable to parse view type as a visualID number: "
										+ type);
			}
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static String getType(int visualID) {
		return Integer.toString(visualID);
	}

	/**
	 * @generated
	 */
	public static int getDiagramVisualID(EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
				.getPattern().isSuperTypeOf(domainElement.eClass())
				&& isDiagram((Pattern) domainElement)) {
			return PatternEditPart.VISUAL_ID;
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static int getNodeVisualID(View containerView, EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		String containerModelID = generalpattern.diagram.part.GeneralPatternMetamodelVisualIDRegistry
				.getModelID(containerView);
		if (!PatternEditPart.MODEL_ID.equals(containerModelID)
				&& !"generalpattern".equals(containerModelID)) { //$NON-NLS-1$
			return -1;
		}
		int containerVisualID;
		if (PatternEditPart.MODEL_ID.equals(containerModelID)) {
			containerVisualID = generalpattern.diagram.part.GeneralPatternMetamodelVisualIDRegistry
					.getVisualID(containerView);
		} else {
			if (containerView instanceof Diagram) {
				containerVisualID = PatternEditPart.VISUAL_ID;
			} else {
				return -1;
			}
		}
		switch (containerVisualID) {
		case PatternEditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return ComponentEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return ConnectorEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getRole().isSuperTypeOf(domainElement.eClass())) {
				return Role2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getMultiplicity().isSuperTypeOf(domainElement.eClass())) {
				return Multiplicity2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getOverlapping().isSuperTypeOf(domainElement.eClass())) {
				return Overlapping2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getStringing().isSuperTypeOf(domainElement.eClass())) {
				return Stringing2EditPart.VISUAL_ID;
			}
			break;
		case PatternPatternCompartmentEditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getRole().isSuperTypeOf(domainElement.eClass())) {
				return RoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern4EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getMultiplicity().isSuperTypeOf(domainElement.eClass())) {
				return MultiplicityEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getOverlapping().isSuperTypeOf(domainElement.eClass())) {
				return OverlappingEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getStringing().isSuperTypeOf(domainElement.eClass())) {
				return StringingEditPart.VISUAL_ID;
			}
			break;
		case RoleRoleCompartmentEditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConstraint().isSuperTypeOf(domainElement.eClass())) {
				return ConstraintEditPart.VISUAL_ID;
			}
			break;
		case ComponentComponentCompartmentEditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponentPort().isSuperTypeOf(domainElement.eClass())) {
				return ComponentPortEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case ComponentComponentCompartment2EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponentPort().isSuperTypeOf(domainElement.eClass())) {
				return ComponentPortEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case ConnectorConnectorCompartmentEditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnectorRole().isSuperTypeOf(domainElement.eClass())) {
				return ConnectorRoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case PatternPatternCompartment2EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getRole().isSuperTypeOf(domainElement.eClass())) {
				return RoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern4EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getMultiplicity().isSuperTypeOf(domainElement.eClass())) {
				return MultiplicityEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getOverlapping().isSuperTypeOf(domainElement.eClass())) {
				return OverlappingEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getStringing().isSuperTypeOf(domainElement.eClass())) {
				return StringingEditPart.VISUAL_ID;
			}
			break;
		case ConnectorConnectorCompartment2EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnectorRole().isSuperTypeOf(domainElement.eClass())) {
				return ConnectorRoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case PatternPatternCompartment3EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getRole().isSuperTypeOf(domainElement.eClass())) {
				return RoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern4EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getMultiplicity().isSuperTypeOf(domainElement.eClass())) {
				return MultiplicityEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getOverlapping().isSuperTypeOf(domainElement.eClass())) {
				return OverlappingEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getStringing().isSuperTypeOf(domainElement.eClass())) {
				return StringingEditPart.VISUAL_ID;
			}
			break;
		case ComponentComponentCompartment3EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponentPort().isSuperTypeOf(domainElement.eClass())) {
				return ComponentPortEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case ConnectorConnectorCompartment3EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnectorRole().isSuperTypeOf(domainElement.eClass())) {
				return ConnectorRoleEditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getComponent().isSuperTypeOf(domainElement.eClass())) {
				return Component3EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConnector().isSuperTypeOf(domainElement.eClass())) {
				return Connector2EditPart.VISUAL_ID;
			}
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getPattern().isSuperTypeOf(domainElement.eClass())) {
				return Pattern3EditPart.VISUAL_ID;
			}
			break;
		case RoleRoleCompartment2EditPart.VISUAL_ID:
			if (org.admanager.generalpattern.plugin.generalpattern.generalpatternPackage.eINSTANCE
					.getConstraint().isSuperTypeOf(domainElement.eClass())) {
				return ConstraintEditPart.VISUAL_ID;
			}
			break;
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static boolean canCreateNode(View containerView, int nodeVisualID) {
		String containerModelID = generalpattern.diagram.part.GeneralPatternMetamodelVisualIDRegistry
				.getModelID(containerView);
		if (!PatternEditPart.MODEL_ID.equals(containerModelID)
				&& !"generalpattern".equals(containerModelID)) { //$NON-NLS-1$
			return false;
		}
		int containerVisualID;
		if (PatternEditPart.MODEL_ID.equals(containerModelID)) {
			containerVisualID = generalpattern.diagram.part.GeneralPatternMetamodelVisualIDRegistry
					.getVisualID(containerView);
		} else {
			if (containerView instanceof Diagram) {
				containerVisualID = PatternEditPart.VISUAL_ID;
			} else {
				return false;
			}
		}
		switch (containerVisualID) {
		case PatternEditPart.VISUAL_ID:
			if (Pattern2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ComponentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ConnectorEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Role2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Multiplicity2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Overlapping2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Stringing2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Pattern2EditPart.VISUAL_ID:
			if (PatternNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (PatternPatternCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ComponentEditPart.VISUAL_ID:
			if (ComponentNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ComponentComponentCompartment3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ConnectorEditPart.VISUAL_ID:
			if (ConnectorNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ConnectorConnectorCompartment3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Role2EditPart.VISUAL_ID:
			if (RoleName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (RoleRoleCompartment2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case RoleEditPart.VISUAL_ID:
			if (RoleNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (RoleRoleCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ConstraintEditPart.VISUAL_ID:
			if (ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Component2EditPart.VISUAL_ID:
			if (ComponentName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ComponentComponentCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Component3EditPart.VISUAL_ID:
			if (ComponentName3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ComponentComponentCompartment2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Connector2EditPart.VISUAL_ID:
			if (ConnectorName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ConnectorConnectorCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Pattern3EditPart.VISUAL_ID:
			if (PatternName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (PatternPatternCompartment2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Connector3EditPart.VISUAL_ID:
			if (ConnectorName3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ConnectorConnectorCompartment2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Pattern4EditPart.VISUAL_ID:
			if (PatternName3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (PatternPatternCompartment3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case PatternPatternCompartmentEditPart.VISUAL_ID:
			if (RoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (MultiplicityEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OverlappingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (StringingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case RoleRoleCompartmentEditPart.VISUAL_ID:
			if (ConstraintEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ComponentComponentCompartmentEditPart.VISUAL_ID:
			if (ComponentPortEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ComponentComponentCompartment2EditPart.VISUAL_ID:
			if (ComponentPortEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ConnectorConnectorCompartmentEditPart.VISUAL_ID:
			if (ConnectorRoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case PatternPatternCompartment2EditPart.VISUAL_ID:
			if (RoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (MultiplicityEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OverlappingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (StringingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ConnectorConnectorCompartment2EditPart.VISUAL_ID:
			if (ConnectorRoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case PatternPatternCompartment3EditPart.VISUAL_ID:
			if (RoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (MultiplicityEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OverlappingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (StringingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ComponentComponentCompartment3EditPart.VISUAL_ID:
			if (ComponentPortEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ConnectorConnectorCompartment3EditPart.VISUAL_ID:
			if (ConnectorRoleEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Component3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Connector2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (Pattern3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case RoleRoleCompartment2EditPart.VISUAL_ID:
			if (ConstraintEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		}
		return false;
	}

	/**
	 * @generated
	 */
	public static int getLinkWithClassVisualID(EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		return -1;
	}

	/**
	 * User can change implementation of this method to handle some specific
	 * situations not covered by default logic.
	 * 
	 * @generated
	 */
	private static boolean isDiagram(Pattern element) {
		return true;
	}

}
